<template>
  <div>
    <footer class="footer-container">
      <ul class="f-list">
        <li
          class="f-item"
          :class="index == 0 ? 'active' : ''"
          @click="toggle(0)"
        >
          <van-icon name="wap-home-o" size="30px" />
          <p>首页</p>
        </li>
        <li
          class="f-item"
          :class="index == 1 ? 'active' : ''"
          @click="toggle(1)"
        >
          <van-icon name="apps-o" size="30px" />
          <p>分类</p>
        </li>
        <li
          class="f-item"
          :class="index == 2 ? 'active' : ''"
          @click="toggle(2)"
        >
          <van-icon name="star-o" size="30px" />
          <p>收藏</p>
        </li>
      </ul>
    </footer>
  </div>
</template>

<script>
// import YimiCategory from "../views/yimi-category.vue";
// import YimiCollection from "../views/yimi-collection.vue";
// import YimiHome from "../views/yimi-home.vue";
export default {
  name: "compFooter",
  // components: { YimiHome, YimiCategory, YimiCollection },
  data() {
    return {
      index: 0,
      // compName: "YimiHome",
    };
  },
  methods: {
    toggle(i) {
      this.index = i;
      // this.compName = name;
    },
  },
};
</script>

<style lang="less" scoped>
.footer-container {
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 1000;
  background-color: #fff;
  .f-list {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .f-item {
      flex-grow: 1;
      text-align: center;
      color: #666;
      p {
        font-size: 16px;
      }
    }
    .active {
      color: chocolate;
    }
  }
}
</style>